import { defineConfig } from 'vite';
import vue2 from '@vitejs/plugin-vue2';

export default defineConfig({
  plugins: [vue2()],
  server: {
    port: 3001,
    proxy: {
      '/api': {
        target: 'http://localhost:3000',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
      '/topList': {
        target: 'https://api.52vmy.cn/api/music/wy/top?t=1',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/topList/, '')
      }
    }
  }
});